<table width="96%" class="ConsoleData">

{#- List the master names in the console. #}
  <tr>
    <td width="1%"></td>
    <td width="1%"></td>
    {%- for master in data.ordered_masters -%}
    {%- if loop.first -%}
      {%- set extraclass = 'first' -%}
    {%- elif loop.last -%}
      {%- set extraclass = 'last' -%}
    {%- else -%}
      {%- set extraclass = '' -%}
    {%- endif %}
    <td class="DevStatus Alt {{ extraclass }} "
      colspan="{{ data.ordered_categories[master]|length }}">
      {%- set master_pretty_name = master -%}
      {%- if master == 'chromium.main' -%}
        {%- set master_pretty_name = 'chromium' -%}
      {%- endif %}
      <a href="http://build.chromium.org/p/{{master_pretty_name}}/console"
         target="_blank">{{ master_pretty_name }}</a>
    </td>
    {%- endfor %}
  </tr>

  <tr class="DevStatusSpacing"></tr>

{#- List the categories in the console. #}
  <tr>
    <td width="1%"></td>
    <td width="1%"></td>
    {%- for master in data.ordered_masters -%}
    {%- for category in data.ordered_categories[master] %}
    <td class="DevSlave">{{ category }}</td>
    {%- endfor -%}
    {%- endfor %}
  </tr>

{#- List the builder statuses in the console. #}
  <tr>
    <td width="1%"></td>
    <td width="1%"></td>
    {%- for master in data.ordered_masters -%}
    {%- set master_pretty_name = master -%}
    {%- if master == 'chromium.main' -%}
      {%- set master_pretty_name = 'chromium' -%}
    {%- endif -%}
    {%- for category in data.ordered_categories[master] %}
    <td class="DevSlave Alt ">
      <table width="100%">
        <tr>
          {%- for builder in data.ordered_builders[master][category] %}
          <td class="DevSlaveBox">
            {{ data.status[master][category][builder] }}
          </td>
          {%- endfor %}
        </tr>
      </table>
    </td>
    {%- endfor -%}
    {%- endfor %}
  </tr>

{#- List the revision data in the console. #}
  {%- for row in data.ordered_rows -%}
  {%- set extraclass = loop.cycle('', 'Alt') %}
  <tr>
    <td width="1%" class="DevRev DevRevCollapse {{ extraclass }}">
      <a href="http://src.chromium.org/viewvc/chrome?view=rev&revision={{ row }}">
        {{ row }}
      </a>
    </td>
    <td width="1%" class="DevName {{extraclass}}">
      {{ data.rows[row].committer }}
    </td>
    {%- for master in data.ordered_masters -%}
    {%- for category in data.ordered_categories[master] %}
    <td class="DevStatus {{extraclass}}">
      <table width="100%">
        <tr>
          {%- for builder in data.ordered_builders[master][category] %}
          <td class="DevStatusBox">
          {%- if master in data.rows[row].status %}
            {{ data.rows[row].status[master][category][builder] }}
          {%- else %}
            {{ data.status[master][category][builder]|notstarted }}
          {%- endif %}
          </td>
          {%- endfor %}
        </tr>
      </table>
    </td>
    {%- endfor -%}
    {%- endfor %}
  </tr>

  <tr>
    <td colspan="{{ 2 + data.category_count }}"
        class="DevComment {{ extraclass }}">
      {{ data.rows[row].comment }}
    </td>
  </tr>

  {%- if data.rows[row].details != '' %}
  <tr>
    <td colspan="{{ 2 + data.category_count }}"
        class="DevDetails {{ extraclass }}">
      {{ data.rows[row].details }}
    </td>
  </tr>
  {%- endif %}

  <tr class="DevStatusSpacing"></tr>
  {%- endfor %}

</table>
